<template>
  <el-dialog
    v-bind="attrs"
    v-on="listeners"
  >
    <div class="info">
      <el-descriptions title="基本信息" border>
        <el-descriptions-item label="评价年月">
          {{ details?.evaluate_record?.time }}
        </el-descriptions-item>

        <el-descriptions-item label="评价人">
          {{ details?.evaluate_record?.user?.username }}
        </el-descriptions-item>
        <el-descriptions-item label="被评价人">
          {{ details?.user?.username }}
        </el-descriptions-item>
        <el-descriptions-item label="评价时间">
          {{ details?.evaluate_record?.evaluate_time }}

        </el-descriptions-item>
      </el-descriptions>

      <el-descriptions title="评价信息" border style="margin-top: 20px;">
        <el-descriptions-item label="评价结果">
          <el-tag size="small">
            {{ details?.result === 1 ? '负面评价' : '正面评价' }}
          </el-tag>
        </el-descriptions-item>
        <el-descriptions-item label="负面理由">
          {{ details?.result === 1 ? badReason : '-' }}
        </el-descriptions-item>
      </el-descriptions>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: '',
  props: {
    details: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {

    }
  },
  computed: {
    attrs() {
      const attrs = { ...this.$attrs }

      return attrs
    },
    listeners() {
      const listeners = { ...this.$listeners }

      return listeners
    },

    badReason() {
      return this.details.reason || this.details?.evaluate_negative_type?.text
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
